package com.koron.order.experiment.bean.convertor;

import com.koron.bean.standard.jobStock.experiment.dto.ExperimentItemDTO;
import com.koron.bean.standard.jobStock.experiment.po.ExperimentItemParams;
import com.koron.bean.standard.jobStock.experiment.po.ExperimentParams;
import com.koron.order.common.bean.po.OrderDispatch;
import com.koron.order.common.bean.po.OrderExecute;
import com.koron.order.experiment.bean.dto.ExperimentDetailDto;
import com.koron.order.experiment.bean.dto.ExperimentDispatchDto;
import com.koron.order.experiment.bean.po.*;
import com.koron.order.experiment.bean.vo.*;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

/**
 * @ClassName ExperimentConvertor
 * @description
 * @Author zhouj
 * @Date 2021/10/9 11:38
 */
@Mapper(componentModel = "spring")
public interface ExperimentConvertor {

    OrderDispatch dtoToBean(ExperimentDispatchDto dto);

    ExperimentPo dtoToBean(ExperimentDetailDto dto);

    ExperimentDispatchVo beanToVo(OrderDispatch orderDispatch);

    OrderExecute voToOrderExecuteVo(ExperimentExecuteInfoVo experimentExecuteInfoVo);

    ExperimentItemPo voToExperimentItemBean(ExperimentItemVo experimentItemVo);

    @Mappings({
            @Mapping(target = "standardParamId", source = "id")
    })
    ExperimentItemParamsPo beanToBean(ExperimentItemParams v);

    ExperimentParamsPo beanToBean(ExperimentParams v);

    @Mappings({
            @Mapping(target = "standardItemId", source = "id")
    })
    ExperimentItemPo dtoToBean(ExperimentItemDTO p);

    ExperimentDetailVo beanToExperimentDetailVo(ExperimentPo experimentPo);

    ExperimentEquipmentPo voToExperimentEquipmentPo(ExperimentEquipmentVo v);

    List<EquipmentConclusionVo> EquipmentPoListToVoList(List<ExperimentEquipmentPo> list);
}
